﻿CREATE PROCEDURE [dbo].[UpdateStorageInfosForOverallUser]
AS
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
    declare @iid uniqueidentifier = '99999999-9999-9999-9999-999999999999';
    
	insert into [UserStorageInfos]
	([InstanceId],[Submission],[AppFoldersSize],[BackupSize],[OperatingSystemSize],[SharedFoldersSize],[SharedFoldersDupSize],[StorageFreeSpace],[StorageSize],[StorageUsedSpace])
	select [InstanceId],[Submission],[AppFoldersSize],[BackupSize],[OperatingSystemSize],[SharedFoldersSize],[SharedFoldersDupSize],[StorageFreeSpace],[StorageSize],[StorageUsedSpace]
	from [UserStorageInfosLatestOverall]
	;
	
	exec dbo.UpdateStorageInfosForUser @iid
RETURN 0